package J9_26;
import J9_26.Utils.BookUtils;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        BookUtils bookUtils = new BookUtils();
        boolean online = true;
        while (online) {
            System.out.println("****************************");
            System.out.println("******  图书管理系统  ******");
            System.out.println("******  1.添加图书  ******");
            System.out.println("******  2.修改图书  ******");
            System.out.println("******  3.删除图书  ******");
            System.out.println("******  4.查询图书  ******");
            System.out.println("******  5.查询所有图书  ***");
            System.out.println("******  0.退出系统  ******");
            System.out.println("****************************");
            System.out.println("请输入操作序号：");
            int choose = sc.nextInt();
            switch (choose) {
                case 0:
                    online = false;
                    break;
                case 1:
                    bookUtils.addBook();
                    break;
                case 2:
                    bookUtils.updateBook();
                    break;
                case 3:
                    bookUtils.deleteBook();
                    break;
                case 4:
                    bookUtils.selectBook();
                    break;
                case 5:
                    bookUtils.selectAll();
                    break;
                default:
                    System.out.println("您的输入有误！");
                    break;
            }
        }
        sc.close();
    }


}
